﻿using System;
using System.Web.UI.WebControls;
using Model;
using MusicSite.ViewClasses;

namespace MusicSite.Views
{
    public partial class Index : BasePage
    {
        private UserProvider usProv = new UserProvider();
        protected void Page_Load(object sender, EventArgs e)
        {
            CheckAuthentication();
            int roleId = usProv.GetUserRole(User.Identity.Name);
            switch (roleId)
            {
                case 2:
                    HyperLink admLink1 = (HyperLink)Master.FindControl("adminLink");
                    admLink1.Visible = false;
                    break;
                case 3:
                    HyperLink admLink = (HyperLink)Master.FindControl("adminLink");
                    admLink.Visible = false;
                    break;
                default:
                    break;
            }
        }
    }
}
